﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class NewDashboard : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
        if (Session["Authentication"] == null)
        {
            Response.Redirect("~/AdminLogin.aspx");
        }
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
        Response.Cache.SetNoStore();

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Session.Clear();
        if (Request.Cookies["MyCookie"] != null)
        {
            var c = new HttpCookie("MyCookie");
            c.Expires = DateTime.Now.AddDays(-1);
            Response.Cookies.Add(c);
        }

        Session.Abandon();
        Response.Cookies.Clear();

        Response.Redirect("AdminLogin.aspx", true);     
    

       
    }
}